<?php

App::import('Vendor', 'kcaptcha/kcaptcha');

class CaptchaComponent extends Object {

    var $Controller = null;

	function startup(&$controller) {
        $this->Controller = & $controller;
    }

    function initialize(&$controller) {

    }


    /**
     * Render Image
     * @param type $name
     */
    function render($name = 'captcha') {
        // Init Captcha
        $kcaptcha = new KCAPTCHA();
        $key = $kcaptcha->getKeyString();
        $this->Controller->Session->write($name, $key);
    }

}
